package com.huibo.aigou.client;

import org.springframework.stereotype.Component;

import com.huibo.aigou.base.bo.AjaxResult;

import feign.hystrix.FallbackFactory;

@Component
public class FallbackHandler implements FallbackFactory<RedisClient> {

	@Override
	public RedisClient create(Throwable cause) {
		return new RedisClient() {
			@Override
			public AjaxResult set(String key, String value) {
				return AjaxResult.createInstance().setCode(500).setMsg("服务器错误");
			}
			@Override
			public String get(String key) {
				return "";
			}
		};
	}

}
